import { Component } from '@angular/core'
import { AdHttpService } from 'monk-design'

@Component({
  selector: '{{selector}}',
  template: `<button mat-flat-button (click)="request()">request</button>`,
})
export class DemoBasicComponent {
  constructor(private http: AdHttpService) {}
  async request() {
    const response = await this.http.get({
      url: './assets/http/test.json',
      observe: 'events',
      params: {
        a: '1',
      },
      uploadProgress(httpProgressEvent) {
        console.log(`uploadProgress:`, httpProgressEvent)
      },
    })
    console.log(response)
  }
}
